package com.example.bledemo.tool;

/**
 * Created by Peter_Z.
 * <p>
 * Date: 2024/10/14 0014
 */
public class Point {
    public int X;
    public int Y;

    // 构造函数
    public Point(int x, int y) {
        X = x;
        Y = y;
    }

    // 重写equals方法
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        Point other = (Point) obj;
        return X == other.X && Y == other.Y;
    }

    // 重写hashCode方法
    @Override
    public int hashCode() {
        int result = Integer.hashCode(X);
        result = 31 * result + Integer.hashCode(Y);
        return result;
    }

    @Override
    public String toString() {
        return "Point{" +
                "X=" + X +
                ", Y=" + Y +
                '}';
    }
}
